home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / program / ixemlsrc.lha / ixemul / libsrc / __panic.c next >
C/C++ Source or Header  |  1995-12-23  |  1KB  |  50 lines

  1. /*
  2.  * This once was req.c by Markus Wandel. It doesn't look too much like the
  3.  * original version though... Well, it was PD, I used it, so here is his
  4.  * original disclaimer:
  5.  *
  6.  * req.c - by Markus Wandel - 1990
  7.  * Placed in the public domain 7 Oct 1990
  8.  * Please have the courtesy to give credit if you use this code
  9.  * in any program.
  10.  *
  11.  */
  12. #include <exec/types.h>
  13. #include <intuition/intuition.h>
  14.  
  15. #include <proto/intuition.h>
  16. #include <proto/exec.h>
  17.  
  18. #define SysBase *(void **)4
  19.  
  20. int __request_msg (const char *msg, const char *button)
  21. {
  22.   struct IntuiText line, righttext;
  23.   struct IntuitionBase *IntuitionBase;
  24.   int result;
  25.  
  26.   /* we (re)open intuition, because that way we don't depend on arp.library
  27.    * being available for us to open intuibase */
  28.  
  29.   if ((IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",0)))
  30.     {
  31.       line.FrontPen = AUTOFRONTPEN;
  32.       line.BackPen = AUTOBACKPEN;
  33.       line.DrawMode = AUTODRAWMODE;
  34.       line.ITextFont = AUTOITEXTFONT;
  35.       line.NextText = 0;
  36.       CopyMem(&line, &righttext, sizeof(line));
  37.       righttext.LeftEdge = AUTOLEFTEDGE;
  38.       righttext.TopEdge = AUTOTOPEDGE;
  39.       line.LeftEdge = 15;
  40.       line.TopEdge = 5;
  41.  
  42.       line.IText = (UBYTE *) msg;
  43.       righttext.IText = (UBYTE *) button;
  44.       result = AutoRequest(0L, &line, 0L, &righttext, 0L, 0L, 320L, 72L);
  45.       CloseLibrary((struct Library *)IntuitionBase);
  46.       return result;
  47.    }
  48.   return -1;
  49. }
  50.